/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_Studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once

#include <UI/UI.h>
#include "框架/屏幕.h"
#include "../播放条.h"


class C_时间轴状态条 : public C_状态条 {

public:
	C_时间轴状态条(S_UI渲染环境& ctx);

	S_Props	m_元素显示位域;

	S_Props	m_播放按钮;
	S_Props	m_当前帧;
	S_Props	m_帧区间;

	void f_重构();
};



class C_时间轴 : public C_Widget {

public:
	C_时间轴(S_UI渲染环境& ctx);
	~C_时间轴();


	static std::set<C_时间轴*> g_当前时间轴页面;


	S_Surface2D*	m_背景;
	S_Surface2D*	m_刻度线;
	S_Surface2D*	m_时间数字;
	S_Surface2D*	m_时间线绘制;

	S_Surface2D*	m_当前时间字符背景;
	S_Surface2D*	m_当前时间字符;


	uint32 m_缓存条;
	uint32 m_缓存名称;

	
	//ivec2	m_帧区;
	float32 m_帧数字步进;
	float32 m_线数量;
	float32 m_帧步进宽度;

	C_时间轴状态条*			mui_状态条;

};

bool			f_时间轴_刷新绘制();

C_时间轴*		f_创建时间轴页面(S_UI渲染环境& ctx);

E_事件是否传递	f_时间轴页面工作区_拖拽时间帧(C_Widget* self, E_键位执行状态 状态);

E_事件是否传递 f_时间轴页面_准备拖动(C_Widget* self, const S_鼠标& 鼠标, S_拖放数据& data);
E_事件是否传递 f_时间轴页面_手柄拖动(C_Widget* self, const S_鼠标& 鼠标, S_拖放数据& data);
bool f_时间轴页面_结束拖放(C_Widget* self, C_Widget* 拾取的部件, S_拖放数据& data);

E_事件是否传递 f_时间轴页面鼠标点击(C_Widget* self, const E_鼠标按钮& 按钮);
E_事件是否传递 f_时间轴页面鼠标滚动(C_Widget* self, const S_鼠标& 鼠标);
E_事件是否传递 f_时间轴页面鼠标按下(C_Widget* self, const E_鼠标按钮& 按钮);
E_事件是否传递 f_时间轴页面鼠标放开(C_Widget* self, const E_鼠标按钮& 按钮);
E_事件是否传递 f_时间轴页面鼠标位置改变(C_Widget* self, const ivec4& mouse);

